/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "EquipmentCleaningHistory")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EquipmentCleaningHistory.findAll", query = "SELECT e FROM EquipmentCleaningHistory e"),
    @NamedQuery(name = "EquipmentCleaningHistory.findByEcid", query = "SELECT e FROM EquipmentCleaningHistory e WHERE e.ecid = :ecid"),
    @NamedQuery(name = "EquipmentCleaningHistory.findByECDate", query = "SELECT e FROM EquipmentCleaningHistory e WHERE e.eCDate = :eCDate")})
public class EquipmentCleaningHistory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ECID")
    private Integer ecid;
    @Column(name = "ECDate")
    @Temporal(TemporalType.DATE)
    private Date eCDate;
    @JoinColumn(name = "ECEmpID", referencedColumnName = "EmpID")
    @ManyToOne(optional = false)
    private Employee eCEmpID;
    @JoinColumn(name = "ECVesselID", referencedColumnName = "equipID")
    @ManyToOne(optional = false)
    private Equipment eCVesselID;
    @JoinColumn(name = "ECProcedureID", referencedColumnName = "VCPID")
    @ManyToOne(optional = false)
    private VesselCleaningProcedure eCProcedureID;

    public EquipmentCleaningHistory() {
    }

    public EquipmentCleaningHistory(Integer ecid) {
        this.ecid = ecid;
    }

    public EquipmentCleaningHistory(Integer ecid, Date eCDate) {
        this.ecid = ecid;
        this.eCDate = eCDate;
    }

    public Integer getEcid() {
        return ecid;
    }

    public void setEcid(Integer ecid) {
        this.ecid = ecid;
    }

    public Equipment getECVesselID() {
        return eCVesselID;
    }

    public void setECVesselID(Equipment eCVesselID) {
        this.eCVesselID = eCVesselID;
    }

    public VesselCleaningProcedure getECProcedureID() {
        return eCProcedureID;
    }

    public void setECProcedureID(VesselCleaningProcedure eCProcedureID) {
        this.eCProcedureID = eCProcedureID;
    }

    public Date getECDate() {
        return eCDate;
    }

    public void setECDate(Date eCDate) {
        this.eCDate = eCDate;
    }

    public Employee getECEmpID() {
        return eCEmpID;
    }

    public void setECEmpID(Employee eCEmpID) {
        this.eCEmpID = eCEmpID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ecid != null ? ecid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EquipmentCleaningHistory)) {
            return false;
        }
        EquipmentCleaningHistory other = (EquipmentCleaningHistory) object;
        if ((this.ecid == null && other.ecid != null) || (this.ecid != null && !this.ecid.equals(other.ecid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.EquipmentCleaningHistory[ ecid=" + ecid + " ]";
    }
    
}
